home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / castools.zip / FUNC7H.ASM < prev    next >
Assembly Source File  |  1990-01-05  |  1KB  |  44 lines

  1. Include multi.inc
  2. Include model.inc
  3.  
  4. ;==============================================================================
  5. ;
  6. ;   CAS function 07h -- Open A File
  7. ;
  8. ;   Format:
  9. ;               int CASOpenFile (int handle, int file, BYTE queue)
  10. ;   Input:
  11. ;               handle of event, receive file number, queue to search
  12. ;   Output:
  13. ;               Returns file handle or negative error code
  14. ;==============================================================================
  15.  
  16.                 .CODE
  17. CASOpenFile     PROC    arg1:WORD, arg2:WORD, arg3:BYTE
  18.  
  19.                 push    bx              ; save registers
  20.                 push    cx
  21.                 push    dx
  22.  
  23.                 mov     ax,MUX          ; load multiplex number
  24.                 mov     ah,al           ; move into ah
  25.                 mov     al,07h          ; CAS function 7
  26.                 mov     bx,arg1         ; event handle
  27.                 mov     cx,arg2         ; receive file number
  28.                 mov     dl,arg3         ; queue to search
  29.                 int     2Fh
  30.  
  31.                 cmp     ax,0            ; ax = 0?
  32.                 jne     FINISH          ; open file failed, return err. code
  33.                 mov     ax,bx           ; move file handle to ax
  34. FINISH:
  35.                 pop     dx              ; restore registers
  36.                 pop     cx
  37.                 pop     bx
  38.                 ret
  39. CASOpenFile     endp
  40.  
  41.                 END
  42.  
  43.  
  44.